home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / novell / lanvax / lan-vax
Text File  |  1996-07-10  |  4KB  |  154 lines

  1. Figure 1: The RAF/Novell architecture.
  2.  
  3.  
  4. Novell's          RAF's             Remote            VT220
  5. NET3.COM          DOS Call          Procedure         Terminal
  6.                   Redirector        Calls             Emulator
  7.  
  8.  
  9. RAF-compatible          RAF Protocol Driver           LAT-compatible
  10. IPX.COM                                               Transport
  11.  
  12.                         RAF's Ethernet Driver
  13.  
  14.  
  15. Figure 2: The RAF Terminal screen, showing the host session commands available to the PC user.
  16.  
  17.  
  18.                   Welcome to RAF Ethernet Service Version 2.1(0)
  19.  
  20. Service Name      Status      Announcement            Services:  4
  21.  
  22. SNEEZY            Available   Datability Office Management System, VMS V5.
  23. DOC               Available   Datability RAF Development System, VMS V5.2
  24. GRUMPY            Available   Datability FACS Development System, VMS V5.2
  25. BASHFU            Available   Datability Client Service System, VMS V4.7
  26.  
  27.  
  28.                   Valid Commands for Version 2.1(0)
  29.  
  30.       ADVISE <name> <password>            BACKWARD
  31.       CONNECT <service>                   DISABLE ADVICE
  32.       DISCONNECT <session #>              ENABLE ADVICE <name> <password>
  33.       FORWARD                             HELP
  34.       RESUME                              SET ADVISEE_CATEGORY <cat>
  35.       SET ATTENTION DISABLE               SET ATTENTION ENABLE <key>
  36.       SET BACKWARD DISABLE                SET BACKWARD ENABLE <key>
  37.       SET FORWARD DISABLE                 SET FORWARD ENABLE <key>
  38.       SET SERVICE_CATEGORY <cat>          SHOW SESSIONS
  39.       SHOW SERVICES                       SHOW TERMINAL
  40.  
  41. RAF>
  42. RAF VT220 Terminal    Wrap                      Ethernet    Mode:Direct
  43.  
  44. Figure 3: Code for FRACPC, the main program run from the PC.
  45.  
  46. #include <stdio.h>
  47. #include <mem.h>
  48. #include <math.h>
  49.  
  50. #define WIDTH 200
  51. #define LENGTH 320
  52. #define ITERATIONS 100
  53. double atof();
  54. double log();
  55.  
  56. char *pix_but;
  57.  
  58. main(argc,argv)
  59. int argc;
  60. char *argv[];
  61. {
  62.       char *malloc();
  63.       double lam_x,lam_y;
  64.       double range;
  65.  
  66.       if(argc!=4)  {
  67.             fprintf(stderr,"Usage - fractal lx ly range\n");
  68.             exit(1);
  69.       }
  70.       lam_x=atof(argv[1]);
  71.       lam_y=atof(argv[2]);
  72.       range=atof(argv[3]);
  73.       rafmscl();              /* Initialize RAF's C Runtine */
  74.       if((pix_buf=maaloc(320*200))!=NULL)  {
  75.             fractal(&lam_x,&lam_y,&range,pix_buf);/* Call the VAX */
  76.             draw_screen(pix_buf);
  77.       }
  78.       else
  79.             printf("Cannot allocate memory\n");
  80. }
  81.  
  82. #include <graphics.h>
  83.  
  84. draw_scren(char pix_buf[LENGTH][WIDTH])
  85. {
  86.       int driver=DETECT;
  87.       int mode=MCGAC0;
  88.       int i,j;
  89.  
  90.       initgraph(&driver,&mode,NULL);
  91.       for(i=0;i<320;i++)  {
  92.             for(j=0;j<200;j++)  {
  93.                   putpixel(i,j,pix_buf[i][j]);
  94.             }
  95.       }
  96.       getch();
  97.       closegraph();
  98. }
  99.  
  100. Figure 4: Code for FRACVAX, the VAX subroutine called by FRACPC to compute the fractals.
  101.  
  102. #include <stdio.h>
  103. #include <math.h>
  104.  
  105. #define XYRATIO 1
  106. #define WIDTH 200
  107. #define LENGTH 320
  108. #define ITERATIONS 100
  109. double atof();
  110. double log();
  111.  
  112. int fractal(double *lx,double *ly,double *nrange,char pix_buf[LENGTH][WIDTH])
  113. {
  114.       double lam_x=(*lx),lam_y=(*ly),range=(*nrange);
  115.       double a,b;
  116.       double zr,zi,zx,zy;
  117.       double dist;
  118.       double t1,t2,zr2,zi2;
  119.       double lr,li;
  120.       double lrstep,listep;
  121.       double y_step,x_step;
  122.       double hrange;
  123.       int n;
  124.       int px,py;
  125.  
  126.       y_step=WIDTH/range;
  127.       x_step=XYRATIO*y_step;
  128.       lrstep=1.0/x_step;
  129.       listep=1.0/y_step;
  130.       hrange=0.5*range;
  131.       for(px=0,a=lam_x+hrange;px<LENGTH;a=lam_x+hrange-px*lrstep,px++)  {
  132.             for(py=0,b=lam_y+hrange;py<WIDTH;b=lam_y+hrange-py*listep,py++)  {
  133.                   zi2=zr2=zi=zr=0.0;
  134.                   for(n=0;(zr+zi2)<=1000.0 && n<ITERATION;n++)  {
  135.                         t1=zr2-zi2-a;
  136.                         zi=2*zr*zi-b
  137.                         zr=t1;
  138.                         zr2=zr*zr;
  139.                         zi2=zi*zi;
  140.                   }
  141.                   if(zr2+zi2>4.0)
  142.                         pix_buf[px][py]=color(n);
  143.                   else
  144.                         pix_buf[px][py]=0;
  145.             }
  146.       }
  147. }
  148.  
  149. int color(int n)
  150. {
  151.       return((n%3)+1);
  152. }
  153.  
  154.